import axios from 'src/utils/http'

export async function getCommentsByArticle (slug: string) {
  const res = await axios.get(`/articles/${slug}/comments`)
  return res.data.comments
}

export async function postComment (slug: string, body: string) {
  await axios.post(`/articles/${slug}/comments`, JSON.stringify({ comment: { body } }))
}